import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:zhongyiapp/pages/index.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Testscreen(),
    );
  }
}

class Testscreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Stack(children: [
      Image.asset(
        'assets/背景图1.png',
        fit: BoxFit.cover,
        width: double.infinity,
        height: double.infinity,
      ),
      Column(children: const [
        Back(),
        Circular(),
        Training(),
        SizedBox(
          height: 15.0,
        ),
        Beginning(),
        SizedBox(
          height: 40.0,
        ),
        Beginning1(),
        SizedBox(
          height: 40.0,
        ),
        Beginning2(),
        SizedBox(
          height: 40.0,
        ),
        Beginning3(),
        SizedBox(
          height: 40.0,
        ),
        Beginning4()
      ]),
    ]));
  }
}

class Back extends StatelessWidget {
  const Back({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
        padding: EdgeInsets.only(top: 30.0),
        height: 90,
        width: 420,
        decoration:
            const BoxDecoration(color: Color.fromARGB(128, 255, 255, 255)),
        child: Column(children: <Widget>[
          ListTile(
            leading: GestureDetector(
              onTap: () {
                // 跳转到目标页面
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => Indexscreen()),
                );
              },
              child: Icon(
                Icons.arrow_back_ios,
                size: 25.0,
                color: Colors.black,
              ),
            ),
            title: Text(
              '考核板块',
              textAlign: TextAlign.center,
              style: TextStyle(fontSize: 25.0),
            ),
            trailing: Icon(
              Icons.settings,
              size: 25.0,
            ),
            onTap: () {
              // 处理点击事件
            },
          ),
        ]));
  }
}

class Circular extends StatelessWidget {
  const Circular({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
        height: 120,
        width: 420,
        decoration: BoxDecoration(
            color: Color.fromARGB(128, 255, 255, 255),
            border: Border.all(color: Colors.grey, width: 1.0)),
        child: Row(children: <Widget>[
          SizedBox(
            width: 18.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center, // 子组件在主轴上的对齐方式
            children: <Widget>[
              Icon(Icons.mail,
                  size: 45.0, color: Color.fromARGB(255, 130, 96, 58)), // 图标
              Text('我的评论',
                  style: TextStyle(
                      fontSize: 20.0,
                      color: Color.fromARGB(255, 140, 139, 139))), // 文本
            ],
          ),
          SizedBox(
            width: 18.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Icon(Icons.star,
                  size: 45.0, color: Color.fromARGB(255, 130, 96, 58)), // 图标
              Text('我的收藏',
                  style: TextStyle(
                      fontSize: 20.0,
                      color: Color.fromARGB(255, 140, 139, 139))), // 文本
            ],
          ),
          SizedBox(
            width: 18.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Icon(Icons.score,
                  size: 45.0, color: Color.fromARGB(255, 130, 96, 58)), // 图标
              Text('排行榜',
                  style: TextStyle(
                      fontSize: 20.0,
                      color: Color.fromARGB(255, 140, 139, 139))), // 文本
            ],
          ),
          SizedBox(
            width: 18.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Icon(Icons.book,
                  size: 45.0, color: Color.fromARGB(255, 130, 96, 58)), // 图标
              Text('我的笔记',
                  style: TextStyle(
                      fontSize: 20.0,
                      color: Color.fromARGB(255, 140, 139, 139))), // 文本
            ],
          ),
        ]));
  }
}

class Training extends StatelessWidget {
  const Training({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
        height: 50.0,
        child: Row(
          children: [
            SizedBox(
              width: 20.0,
            ),
            Text(
              '章节训练',
              style: TextStyle(
                  fontFamily: '行楷',
                  fontSize: 27.0,
                  color: Color.fromARGB(255, 154, 117, 75),
                  decoration: TextDecoration.underline,
                  decorationColor: Color.fromARGB(255, 130, 96, 58)),
            )
          ],
        ));
  }
}

class Beginning extends StatelessWidget {
  const Beginning({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 400,
      height: 80,
      decoration: BoxDecoration(
          color: Color.fromARGB(128, 255, 255, 255),
          border: Border.all(color: Colors.grey, width: 0.5),
          borderRadius: BorderRadius.circular(8.0)),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween, // 使子组件在主轴上间隔均匀分布
        children: <Widget>[
          SizedBox(
            width: 2.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center, // 子组件在主轴上的对齐方式
            crossAxisAlignment: CrossAxisAlignment.start, // 子组件在交叉轴上的对齐方式
            children: <Widget>[
              Text('中药学',
                  style: TextStyle(
                    fontSize: 25.0,
                  )),
            ],
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text('（0/1759）',
                  style: TextStyle(
                    fontSize: 18.0,
                    fontWeight: FontWeight.bold,
                  )),
            ],
          ),
          ElevatedButton(
            onPressed: () {
              // 按钮点击事件
              print('Button pressed');
            },
            child: Text('开始训练'),
            style: ElevatedButton.styleFrom(
              foregroundColor: Colors.white,
              backgroundColor: Color.fromARGB(255, 130, 96, 58), // 按钮的文字颜色
            ),
          ),
          SizedBox(
            width: 1.0,
          )
        ],
      ),
    );
  }
}

class Beginning1 extends StatelessWidget {
  const Beginning1({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 400,
      height: 80,
      decoration: BoxDecoration(
          color: Color.fromARGB(128, 255, 255, 255),
          border: Border.all(color: Colors.grey, width: 0.5),
          borderRadius: BorderRadius.circular(8.0)),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween, // 使子组件在主轴上间隔均匀分布
        children: <Widget>[
          SizedBox(
            width: 2.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center, // 子组件在主轴上的对齐方式
            crossAxisAlignment: CrossAxisAlignment.start, // 子组件在交叉轴上的对齐方式
            children: <Widget>[
              Text('中医诊断学',
                  style: TextStyle(
                    fontSize: 25.0,
                  )),
            ],
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text('（0/250）',
                  style: TextStyle(
                    fontSize: 18.0,
                    fontWeight: FontWeight.bold,
                  )),
            ],
          ),
          ElevatedButton(
            onPressed: () {
              // 按钮点击事件
              print('Button pressed');
            },
            child: Text('开始训练'),
            style: ElevatedButton.styleFrom(
              foregroundColor: Colors.white,
              backgroundColor: Color.fromARGB(255, 130, 96, 58), // 按钮的文字颜色
            ),
          ),
          SizedBox(
            width: 1.0,
          )
        ],
      ),
    );
  }
}

class Beginning2 extends StatelessWidget {
  const Beginning2({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 400,
      height: 80,
      decoration: BoxDecoration(
          color: Color.fromARGB(128, 255, 255, 255),
          border: Border.all(color: Colors.grey, width: 0.5),
          borderRadius: BorderRadius.circular(8.0)),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween, // 使子组件在主轴上间隔均匀分布
        children: <Widget>[
          SizedBox(
            width: 2.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center, // 子组件在主轴上的对齐方式
            crossAxisAlignment: CrossAxisAlignment.start, // 子组件在交叉轴上的对齐方式
            children: <Widget>[
              Text('方剂学',
                  style: TextStyle(
                    fontSize: 25.0,
                  )),
            ],
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text('（0/289）',
                  style: TextStyle(
                    fontSize: 18.0,
                    fontWeight: FontWeight.bold,
                  )),
            ],
          ),
          ElevatedButton(
            onPressed: () {
              // 按钮点击事件
              print('Button pressed');
            },
            child: Text('开始训练'),
            style: ElevatedButton.styleFrom(
              foregroundColor: Colors.white,
              backgroundColor: Color.fromARGB(255, 130, 96, 58), // 按钮的文字颜色
            ),
          ),
          SizedBox(
            width: 1.0,
          )
        ],
      ),
    );
  }
}

class Beginning3 extends StatelessWidget {
  const Beginning3({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 400,
      height: 80,
      decoration: BoxDecoration(
          color: Color.fromARGB(128, 255, 255, 255),
          border: Border.all(color: Colors.grey, width: 0.5),
          borderRadius: BorderRadius.circular(8.0)),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween, // 使子组件在主轴上间隔均匀分布
        children: <Widget>[
          SizedBox(
            width: 2.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center, // 子组件在主轴上的对齐方式
            crossAxisAlignment: CrossAxisAlignment.start, // 子组件在交叉轴上的对齐方式
            children: <Widget>[
              Text('中医基础理论',
                  style: TextStyle(
                    fontSize: 25.0,
                  )),
              // 根据需要可以添加更多组件
            ],
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text('（0/640）',
                  style: TextStyle(
                    fontSize: 18.0,
                    fontWeight: FontWeight.bold,
                  )),
            ],
          ),
          ElevatedButton(
            onPressed: () {
              // 按钮点击事件
              print('Button pressed');
            },
            child: Text('开始训练'),
            style: ElevatedButton.styleFrom(
              foregroundColor: Colors.white,
              backgroundColor: Color.fromARGB(255, 130, 96, 58), // 按钮的文字颜色
            ),
          ),
          SizedBox(
            width: 1.0,
          )
        ],
      ),
    );
  }
}

class Beginning4 extends StatelessWidget {
  const Beginning4({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 400,
      height: 80,
      decoration: BoxDecoration(
          color: Color.fromARGB(128, 255, 255, 255),
          border: Border.all(color: Colors.grey, width: 0.5),
          borderRadius: BorderRadius.circular(8.0)),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween, // 使子组件在主轴上间隔均匀分布
        children: <Widget>[
          SizedBox(
            width: 2.0,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center, // 子组件在主轴上的对齐方式
            crossAxisAlignment: CrossAxisAlignment.start, // 子组件在交叉轴上的对齐方式
            children: <Widget>[
              Text('实践技能',
                  style: TextStyle(
                    fontSize: 25.0,
                  )),
            ],
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text('（0/1183）',
                  style: TextStyle(
                    fontSize: 18.0,
                    fontWeight: FontWeight.bold,
                  )),
            ],
          ),
          ElevatedButton(
            onPressed: () {
              // 按钮点击事件
              print('Button pressed');
            },
            child: Text('开始训练'),
            style: ElevatedButton.styleFrom(
              foregroundColor: Colors.white,
              backgroundColor: Color.fromARGB(255, 130, 96, 58), // 按钮的文字颜色
            ),
          ),
          SizedBox(
            width: 1.0,
          )
        ],
      ),
    );
  }
}
